<include file="Common:layout" />
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>店铺管理</h3>
                <h5>网站系统店铺索引与管理</h5>
            </div>
        </div>
    </div>

    <div id="explanation" class="explanation">
        <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示 冻结店铺后,店铺的管理员将没法登录后台</h4>
            <span title="收起提示" id="explanationZoom"></span>
        </div>
        <ul>
            <li></li>
        </ul>
    </div>

    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>店铺列表</h3>
                <h5></h5>
            </div>

            <form action="{:U('Shop/index')}" class="navbar-form form-inline" method="get">
                <input type="hidden" name="m" value="Admin">
                <input type="hidden" name="c" value="Shop">
                <input type="hidden" name="a" value="index">
                <div class="sDiv">
                    <div class="sDiv2">

                        <select name="state" id="state" class="select" style="min-width:130px;">
                            <option value="-2" <if condition="$state eq -2">selected</if> >审核状态</option>
                            <option value="0" <if condition="$state eq 0">selected</if> >未审核</option>
                            <option value="1" <if condition="$state eq 1">selected</if> >已通过</option>
                            <option value="-1" <if condition="$state eq -1">selected</if> >不通过</option>
                        </select>

                        <input type="text" size="30" name="shop_name" id="shop_name" placeholder="店铺名称" value="{$shop_name}">
                        <input type="submit" class="btn" name="btn" value="搜索"/>
                    </div>
                </div>
            </form>
        </div>

            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0">
                        <thead>
                        <tr>
                            <th align="center" abbr="article_title" axis="col6">
                                <div style="text-align: center; width:50px;" class="">店铺ID</div>
                            </th>
                            <th align="center" abbr="article_title" axis="col3" class="">
                                <div style="text-align: center; width: 100px;" class="">店铺名称</div>
                            </th>
                            <th align="center" abbr="ac_id" axis="col4" class="">
                                <div style="text-align: center; width: 80px;" class="">店主账号</div>
                            </th>
                            <th align="center" abbr="ac_id" axis="col4" class="">
                                <div style="text-align: center; width: 120px;" class="">入驻时间</div>
                            </th>
                            <th align="center" abbr="article_show" axis="col5" class="">
                                <div style="text-align: center; width: 100px;" class="">状态</div>
                            </th>
                            <th align="center" abbr="article_show" axis="col5" class="">
                                <div style="text-align: center; width: 130px;" class="">操作</div>
                            </th>
                            <th style="width:100%" axis="col7">
                                <div></div>
                            </th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div class="tDiv">
                <div class="tDiv2">
                    <div class="fbutton">
                        <a href="{:U('Shop/createShop')}">
                            <div class="add" title="添加店铺">
                                <span><i class="fa fa-plus"></i>添加店铺</span>
                            </div>
                        </a>
                    </div>
                </div>
                <div style="clear:both"></div>
            </div>
            <div class="bDiv" style="height: auto;">
                <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                    <table>
                        <tbody>
                        <volist name="shop" id="vo" empty="没有数据!">
                            <tr>
                                <td align="center" axis="col0">
                                    <div style="width: 50px;">{$vo['id']}</div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: left; width: 100px;">{$vo['shop_name']}</div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: left; width: 80px;">{$vo['shop_name']}</div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: left; width: 120px;">
                                        {$vo['create_time']|date="Y-m-d H:i:s",###}
                                    </div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: center; width: 100px;">
                                        <if condition="$vo['state'] eq -1">
                                            <span style="color: red;">不通过</span>
                                        <elseif condition="$vo['state'] eq 0"/>
                                            <span style="color: blue;">未审核</span>
                                        <else />
                                            <span style="color: green;">已通过</span>
                                        </if>


                                       <if condition="$vo['frozen'] eq 1">
                                           <span style="color: pink;">已冻结</span>
                                       <else />
                                           <span style="color: grey;">未冻结</span>
                                       </if>

                                    </div>
                                </td>
                                <td align="center" class="">
                                    <div style="text-align: left; width: 130px;">
                                        <a class="btn blue" href="{:U('Shop/getShop', array('id'=>$vo['id']))}"><i class="fa fa-search"></i>查看</a>
                                        <if condition="$vo['frozen'] eq 0">
                                            <a class="btn red frozen" href="javascript:;" data-id="{$vo['id']}"><i class="fa fa-search"></i>冻结</a>
                                        <else/>
                                            <a class="btn green unfrozen" href="javascript:;" data-id="{$vo['id']}"><i class="fa fa-search"></i>解冻</a>
                                        </if>
                                    </div>
                                </td>
                                <td align="" class="" style="width: 100%;">
                                    <div>&nbsp;</div>
                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                </div>
                <!--分页位置-->
                {$page}
            </div>
    </div>
</div>
<script type="text/javascript">
    $(function() {

        //冻结店铺
        $('.frozen').click(function() {
            var shop_id = $(this).attr('data-id');
            layer.confirm('您确认要冻结此店铺吗?', {
              btn: ['确认','取消']
            }, function(){
                $.ajax({
                    url: "{:U('shop/frozen')}",
                    type: 'post',
                    data: {
                        'shop_id': shop_id
                    },
                    success: function() {
                      window.location.reload();
                    }
                });
            });
        });

        //解冻店铺
        $('.unfrozen').click(function() {
            var shop_id = $(this).attr('data-id');
            layer.confirm('您确认要解冻此店铺吗?', {
              btn: ['确认','取消']
            }, function(){
                $.ajax({
                    url: "{:U('shop/unfrozen')}",
                    type: 'post',
                    data: {
                        'shop_id': shop_id
                    },
                    success: function() {
                        window.location.reload();
                    }
                });
            });
        });



    });
</script>
</body>
</html>